<?php

/**
 * Subclass for representing a row from the 'faq' table.
 *
 *
 *
 * @package lib.model
 */
class Faq extends BaseFaq
{

	/**
	 * Faq::getNameLng()
	 * Retrieves object name from database depending on user culture
	 * @return translated Name
	 */
	public function getNameLng()
    {
        $this->setCulture(sfContext::getInstance()->getUser()->getCulture());
        return $this->getName();
    }

	/**
	 * Faq::hydrate()
	 * Sets culture to result set retrieved from database in order not to set it everytime when writing new method
	 * @param ResultSet $rs
	 * @param integer $startcol
	 *
	 */
	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		$this->setCulture(sfContext::getInstance()->getUser()->getCulture());
		parent::hydrate($rs, $startcol);
	}
    public function delete($con = null)
    {
        Files::deleteByObjId($this->id, true, MyConstants::TYPE_FAQ);
        parent::delete($con);
    }
}